using System;

namespace voidbox
{
    public struct Color
    {
        public float r;
        public float g;
        public float b;
        public float a;

        public Color(float _r, float _g, float _b, float _a)
        {
            r = _r; if(_r<0)_r = 0;if (_r > 1) _r = 1;
            g = _g; if (_g < 0) _g = 0; if (_g > 1) _g = 1;
            b = _b; if (_b < 0) _b = 0; if (_b > 1) _b = 1;
            a = _a; if (_a < 0) _a = 0; if (_a > 1) _a = 1;
        }

        public static Color White
        {
            get
            {
                return new Color(1, 1, 1, 1);
            }
        }
        public static Color Black
        {
            get
            {
                return new Color(0, 0, 0, 1);
            }
        }
        public static Color Mul(Color a, Color b)
        {
            return new Color(a.r * b.r, a.g * b.g, a.b * b.b, a.a * b.a);
        }
    }
}